package cn.whao.guli.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: RouteConfig
 * Package: cn.whao.guli.gateway.config
 * Description:
 *
 * @Author 王豪
 * @Create 2024/11/28 17:16
 * @Version 1.0
 */
@Configuration
public class RouteConfig {

    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("stock-route",r->r.path("/stock/**").uri("lb://guli-stock"))
                .build();
    }
}
